﻿using BPMN.Application.IService;
using BPMN.Domain;
using BPMN.Domain.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPMN.Application.Service
{
    public class AppServiceBase<T> : IAppServiceBase<T> where T : class
    {
        /// <summary>
        /// 全局变量
        /// </summary>
        private readonly IRepositoryBase<T> repostoryBase;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="repostoryBase">获取仓储层</param>
        public AppServiceBase(IRepositoryBase<T> repostoryBase)
        {
            this.repostoryBase = repostoryBase;
        }

        //public async Task<int> Add(T entity)
        //{
        //    return await repostoryBase.Add(entity);
        //}

        public async Task<int> Delete(int Id)
        {
            return await repostoryBase.Delete(Id);
        }

        //public async Task<int> RealDel(int Id)
        //{
        //    return await repostoryBase.RealDel(Id);
        //}



        //public async Task<T> Get(int Id)
        //{
        //    return await repostoryBase.Get(Id);
        //}

        //public async Task<IQueryable<T>> GetAll()
        //{
        //    return await repostoryBase.GetAll();
        //}

        //public async Task<int> SaveChange()
        //{
        //    return await SaveChange();
        //}

        //public async Task<int> Update(T entity)
        //{
        //    return await repostoryBase.Update(entity);
        //}

        //public async Task<dynamic> GetListPage(int PageIndex, int PageSize)
        //{
        //    return await repostoryBase.GetListPage(PageIndex, PageSize);
        //}
    }
}
